<?php


class projectModel extends Model
{
    public  function __construct($options=array())
    {
        parent::__construct($options);
    }

     public function getList($table,$where){
         $data = $this->select($table,'*',$where);
         foreach ($data as $k=>$v){
             $list[$k]['eid']=$v['eid'];
             $list[$k]['ep_name']= $this->get('sp_enterprises','ep_name',['AND'=>['eid'=>$v['eid']]]);
             $list[$k]['cti_code']=$v['cti_code'];
             $list[$k]['iso']=$v['iso'];
             $list[$k]['audit_ver']=$v['audit_ver'];
         }
         $table = getTable(['公司ID','公司名', '项目编号','体系短代码','体系标准版本'], $list,['url1','url2']);
         return $table;
     }

     public function getSearchForm(){
         require_once getFileUri('from');
         $form=new form($_SERVER['PHP_SELF']);
         $form->layout=false;                   //不使用表格布局，大家可以把这句注释掉看结果有何不同
         $name=$form->form_text("ep_name","ep_name","公司名称","ep_name");
         $submit=$form->form_button("","button","button","搜索",'serach()');
         $form_item=array($name,$submit);
         $fromDom=$form->CreateForm($form_item);
         return $fromDom;
     }

}